package org.geek4j.repository;

import org.geek4j.base.BaseTest;
import org.geek4j.domain.Person;
import org.junit.Test;
import org.springframework.beans.factory.annotation.Autowired;

import lombok.extern.slf4j.Slf4j;

/**
 * @author Geek4J
 * @description PersonRepository rest
 */
@Slf4j
public class PersonRepositoryT extends BaseTest {

	@Autowired
	private PersonRepository personRepository;

	/**
	 * @author Geek4J
	 * @description PersonRepository save
	 */
	@Test
	public void save() {
		Person geek4j = new Person();
		geek4j.setName("宋骁");
		geek4j.setAge(17);
		personRepository.save(geek4j);
	}

	/**
	 * @author Geek4J
	 * @description PersonRepository save
	 */
	@Test
	public void findOne() {
		Long persionId = 2L;
		Person geek4j = personRepository.findOne(persionId);
		log.error(geek4j.getName());
	}
}